(function (root, factory) {
    'use strict'
    if(typeof define === "function" && define.amd) {
        define(["Workshift"], factory);
    }
    else if(typeof module === "object" && module.exports) {
        var Workshift;
        try {
            Workshift = require("Workshift");
        }
        catch (err) {
            Workshift = null;
        }
        module.exports = factory(jQuery);
    }
    else {
        root.Workshift = factory();
    }
})(this, function () {
    'use strict'

    function Workshift() {
        this.request = {
            login: function(username, password, client, verifycode){
                Wolf.postSynch('/workshift/user/login',{
                    "username": username,
                    "password": password,
                    "client": client,
                    "verifycode": verifycode
                }, function(response){
                    console.log(response);
                    if(response.failure){
                        Wolf.alert(response.message);
                        return;
                    }
                    window.location.href="/workshift/view/index";
                })
            },
            logout: function(){
                Wolf.postSynch('/workshift/user/logout',{}, function(response){
                    window.location.href="/workshift/view/logout";
                })
            }
        }
    };

    Workshift.prototype = {

    };

    return new Workshift();
})